<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>招聘商户界面</title>
    <link rel="stylesheet" href="../../plugins/element-ui/index.css">


    <style>
        .el-header {
            background-color: #B3C0D1;
            color: #333;
            line-height: 60px;
        }

        .el-aside {
            color: #333;
        }
    </style>

</head>
<body>
<div id="app">

    <el-container style="height: 700px; border: 1px solid #eee">
        <!--1.侧边菜单-->
        <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
            <el-menu>

                <el-submenu index="1">
                    <template slot="title"><i class="el-icon-s-custom"></i>个人信息</template>
                    <el-menu-item-group>
                        <template slot="title">分组一</template>
                        <el-menu-item index="1-1" @click="clickUrl('a')">修改个人信息</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>

                <el-submenu index="2">
                    <template slot="title"><i class="el-icon-s-data"></i>岗位管理</template>
                    <el-menu-item-group>
                        <template slot="title">分组一</template>
                        <el-menu-item index="2-1" @click="clickUrl('b')">岗位信息</el-menu-item>
                        <el-menu-item index="2-2" @click="clickUrl('c')">求职者审核</el-menu-item>
                        <el-menu-item index="2-3" @click="clickUrl('d')">在岗学生</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>

                <el-submenu index="3">
                    <template slot="title"><i class="el-icon-s-fold"></i>工资</template>
                    <el-menu-item-group>
                        <template slot="title">分组一</template>
                        <el-menu-item index="3-1" @click="clickUrl('e')">工资管理</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>

                <el-submenu index="4">
                    <template slot="title"><i class="el-icon-message-solid"></i>留言反馈</template>
                    <el-menu-item-group>
                        <template slot="title">分组一</template>
                        <el-menu-item index="4-1" @click="clickUrl('f')">留言反馈</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>

            </el-menu>
        </el-aside>

        <!--2.上边栏-->
        <el-container style=" text-align: right; font-size: 12px">
            <el-header style="text-align: right; font-size: 12px">
                <h1 style="position:absolute;margin-right: 15px">{{infoName}}</h1>

                <img style="width: 50px;height: 50px;border-radius: 40%;position: absolute;margin: 5px 0 0 -60px" :src="imageUrl">
                <el-dropdown>
                    <i class="el-icon-setting" style="margin-right: 15px"></i>
                    <el-dropdown-menu slot="dropdown">
                        <el-dropdown-item>
                            <p @click="clickUrl(0)">修改个人信息</p>
                        </el-dropdown-item>
                        <el-dropdown-item>
                            <p @click="loginOut(1)">退出账号</p>
                        </el-dropdown-item>
                    </el-dropdown-menu>
                </el-dropdown>

            <span> {{ recruitmentInfo.data.name }}</span>
            </el-header>

            <!--3.主内容(iframe)-->
                <el-main>
                    <iframe
                            :src="iframeUrl"
                            frameborder="0"
                            name="iframe0"
                            width="100%"
                            height="100%"
                    ></iframe>
                </el-main>
        </el-container>
    </el-container>

</div>


<script src="../../plugins/vue/vue.js"></script>

<!-- 引入element-ui组件库 -->
<script src="../../plugins/element-ui/index.js"></script>

<!-- 引入axios -->
<script src="../../plugins/axios/axios.min.js"></script>

<script>
    new Vue({
        el:'#app',    //element
        data:{
            infoName:'',  //标题
            recruitmentInfo:{}, //当前用户信息
            iframeUrl:'recruitmentWelcome.html', //主内容的url

            imageUrl:''
        },
        created() {
            const recruitmentInfo = window.localStorage.getItem('recruitment')
            console.log("recruitmentInfo1:::"+recruitmentInfo)
            if (recruitmentInfo) {
                this.recruitmentInfo = JSON.parse(recruitmentInfo)
            }
            console.log("recruitmentInfo2:::"+recruitmentInfo)

            this. imageUrl=`/files/downloadFile?name=${this.recruitmentInfo.data.image}`
        },
        methods:{

            clickUrl(index){
                if (index=="a"){
                    this.infoName='修改个人信息'
                    this.iframeUrl='list/updateRecruitmentMyself.html'
                } else  if (index=="b"){
                    this.infoName='岗位信息'
                    this.iframeUrl='list/postList.html'
                }else if (index=="c"){
                    this.infoName='求职者审核'
                    this.iframeUrl='list/postApplicationList.html'
                }else  if (index=="d"){
                    this.infoName='在岗学生'
                    this.iframeUrl='list/onJobStudent.html'
                }else if (index=="e"){
                    this.infoName='工资管理'
                    this.iframeUrl='list/salaryGiveList.html'
                }else if (index=="f"){
                    this.infoName='留言反馈'
                    this.iframeUrl='list/feedbackList.html'
                }
            },
            loginOut(){
                localStorage.setItem('recruitment',null)
                window.location.href='../Login/Login.html';
            },

        }

    })
</script>

</body>
</html>